//
//  vhECGPath.h
//  vhECGTools
//
//  Created by jia yu on 2021/11/19.
//

#import <UIKit/UIkit.h>
#import <vhECGTools/vhECGTools.h>

NS_ASSUME_NONNULL_BEGIN
@interface vhECGPath : NSObject

/*
 Don't forgot call CGPathRelease(path);
 */
#pragma mark - 12x1
//for style 12x1
+(CGMutablePathRef)build12x1Path:(NSArray <NSArray <NSNumber *>*>*)ecgsArray zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm;
+(void)draw12x1LeadName:(NSDictionary *)standardAtt startX:(float)start_x startY:(float)start_y lineSpace:(float)perlineSpace pixPermm:(float)pixPermm;
+(CGMutablePathRef)build12x1STPath:(NSArray <NSArray <NSNumber *>*>*)stsArray uvs:(NSArray <NSNumber *>*)uvsArray slopes:(NSArray <NSNumber *>*)slopesArray posZ:(short)Z posJ:(short)J posJms:(NSInteger)jmsIndex zeroX:(float)start_x zeroY:(float)start_y rateY:(float)y_rate pointPerPoint:(float)seekPerPoint lineSpace:(float)perLineSpace pixPermm:(float)pixPermm;
+(void)draw12x1STValue:(NSDictionary *)fontAtt
              unitFont:(NSDictionary *)unitFontAtt
                   uvs:(NSArray <NSNumber *>*)uvsArray
               uvsUnit:(UISettingSTUnit)unit
                slopes:(NSArray <NSNumber *>*)slopesArray
                 zeroX:(float)start_x
                 zeroY:(float)start_y
                 width:(float)width
             lineSpace:(float)lineSpace;

#pragma mark - 3x4
//for style 3x4 with Synchronization ECG
+(CGMutablePathRef)build3x4Path:(NSArray <NSArray <NSNumber *>*>*)ecgsArray fullLead:(ECGLead)extLead ecgFromIndex:(int)fromIndex zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm;
+(void)draw3x4LeadName:(NSDictionary *)standardAtt fullLead:(ECGLead)extLead zeroX:(float)start_x ecgWidth:(float)ecgWidth zeroY:(float)start_y lineSpace:(float)perlineSpace pix:(float)pixPermm;

//for style 3x4 with Continunce ECG
+(CGMutablePathRef)build3x4ContinuncePath:(NSArray <NSArray <NSNumber *>*>*)ecgsArray fullLead:(ECGLead)extLead zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm;

#pragma mark - 6x2
//for style 6x2 with Synchronization ECG
+(CGMutablePathRef)build6x2Path:(NSArray <NSArray <NSNumber *>*>*)ecgsArray fullLead:(ECGLead)extLead ecgFromIndex:(int)fromIndex zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm;
+(void)draw6x2LeadName:(NSDictionary *)standardAtt fullLead:(ECGLead)extLead zeroX:(float)start_x ecgWidth:(float)ecgWidth zeroY:(float)start_y lineSpace:(float)perlineSpace pix:(float)pixPermm;

//for style 6x2 with Continunce ECG
+(CGMutablePathRef)build6x2ContinuncePath:(NSArray <NSArray <NSNumber *>*>*)ecgsArray fullLead:(ECGLead)extLead zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm;

#pragma mark - LIMB
+(CGMutablePathRef)buildLIMBPath:(NSArray <NSArray <NSNumber *>*>*)ecgsArray zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm;
+(void)drawLIMBLeadName:(NSDictionary *)standardAtt startX:(float)start_x startY:(float)start_y lineSpace:(float)perlineSpace pixPermm:(float)pixPermm;

#pragma mark - Custom
+(CGMutablePathRef)buildCustomPath:(NSArray <NSArray <NSNumber *>*>*)ecgsArray zeroX:(float)start_x pointPerPoint:(float)seekPerPoint zeroY:(float)start_y rateY:(float)y_rate lineSpace:(float)perlineSpace pix:(float)pixPermm customLeads:(NSArray <NSNumber *>*)leadsArray;
+(void)drawCustomLeadName:(NSDictionary *)standardAtt startX:(float)start_x startY:(float)start_y lineSpace:(float)perlineSpace pixPermm:(float)pixPermm customLeads:(NSArray <NSNumber *>*)leadsArray;



#pragma mark - Background Lines
+(CGMutablePathRef)buildBg_mmLinesIn:(CGRect)rect pix:(float)pixPermm;
+(CGMutablePathRef)buildBg_5mmLinesIn:(CGRect)rect pix:(float)pixPermm;
+(CGMutablePathRef)buildBg_10mmLinesIn:(CGRect)rect pix:(float)pixPermm;


#pragma mark - Single ECG Line
+(CGMutablePathRef)buildOneLineECG:(NSArray <NSNumber *>*)ecgsArray zeroX:(float)start_x pointPerPoint:(float)seekPerPoint middleY:(float)middle rateY:(float)y_rate pix:(float)pixPermm;
@end
NS_ASSUME_NONNULL_END
